import {WidgetClass} from "../atom/widget";

export class PlatformEZLink extends WidgetClass {
  constructor(options = {}) {
    super(options);
    const {ports,UI} = options;
    if (UI) {
      this.UI.data = UI.data;
    } else {
      this.UI.data = {
        type: "faceRecognition",
        recognitionRect:{
          top:0,
          left:0,
          width:200,
          height:200
        }
      };
    }
    if (ports) {
      this.ports = ports;
    } else {
      this.ports = this.assembleDefaultPorts();
    }
  }

  assembleDefaultState(options = {}) {
    const superState = super.assembleDefaultState(options);
    return {
      ...superState,
    };
  }

  assembleDefaultPorts() {
    const superState = super.assembleDefaultPorts();
    return {
      ...superState,
      values: [
        ...superState.values,

      ],
      events: [
        ...superState.events,
      ],
    };
  }
}
